package leetcode.easy;

/**
 * ClassName: $461_HammingDistance
 * Description:
 * date: 2022-02-19 18:04
 *
 * @author liyifan
 */
public class $461_HammingDistance {
    public int hammingDistance(int x, int y) {
        int xor = x ^ y;
        int count = 0;
        while (xor > 0) {
            if ((1 & xor) == 1) {
                count++;
            }
            xor = xor >>> 1;
        }
        return count;
    }
}
